/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Steffen
 */
@ManagedBean
@ApplicationScoped
public class Verwaltung {
    private final static String START= "./index.xhtml?faces-redirect=true";
    private final static String REPLIES= "./postReply.xhtml?faces-redirect=true";
    private List<Forum> foren = new ArrayList() {};
    private Forum aktuell;
    
    public Verwaltung(){
        
    }

    public void createForum(Forum forum) {
        if(!forum.getTheme().equals("")){
            foren.add(new Forum(forum.getTheme()));
        }
        forum.setTheme("");
        
       
    }
    
 
    public void setAktuell(Forum forum) {
        this.aktuell = forum;
    }

    public Forum getAktuell() {
        return this.aktuell;
    }
    
    public List getForen(){
        return this.foren;
    }
    
    /**
     * @return the START
     */
    public String toStart() {
        
        return START;
    }

    /**
     * @return the TOPIC
     */
    public String toTopic(Forum f) {
        //Forum f = searchForForum(target);
        /*if(f!=null){
            this.aktuell = f;
        }*/
        this.aktuell = f;
        return REPLIES;
        
    }
     
    
    
}